<?php


namespace app\model;


use think\Model;

class ArticleLikeModel extends Model
{
    protected $table = 'likes';

    // 设置字段信息
    protected $schema = [
        'uid' => 'int',
        'articleId' => 'int',
        'createTime' => 'datetime',
    ];

    //自动时间戳
    protected $autoWriteTimestamp = 'datetime';
    protected $updateTime = false;
    protected $createTime = 'createTime';

    // 相对关系 文章
    public function article()
    {
        $this->belongsTo(ArticleModel::class, 'id', 'articleId');
    }
}